package com.moneyhelper.common.resp;

import cn.hutool.http.HttpStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author： ygl
 * @date： 2019/02/15
 * @Description：
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class RestResponse extends BaseResponse{

    private Object data;

    public static RestResponse OK(Object obj){
        RestResponse restResponse = new RestResponse();
        restResponse.setData(obj);
        return restResponse;
    }

    public static RestResponse OK(){
        RestResponse restResponse = new RestResponse();
        return restResponse;
    }

    public static RestResponse ERROR(Object obj){
        RestResponse restResponse = new RestResponse();
        restResponse.setStatus(HttpStatus.HTTP_INTERNAL_ERROR);
        restResponse.setData(obj);
        return restResponse;
    }

    public static RestResponse ERROR(){
        RestResponse restResponse = new RestResponse();
        restResponse.setStatus(HttpStatus.HTTP_INTERNAL_ERROR);
        return restResponse;
    }

}
